package com.spddr.pmos.jpa;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@Entity
@Table(name = "customer_info")
@DiscriminatorValue(value = "13")
public class Customer extends Organization {
	private static final long serialVersionUID = 1L;

	private VoltageLevel voltageLevel;

	public Customer() {
	}

	public Customer(Long id) {
		super(id);
	}

	public Customer(Long id, String name) {
		super(id, name);
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "voltage")
	@JsonSerialize(using = cn.seqdata.jackson.TypeSerializer.IdName.class)
	public VoltageLevel getVoltageLevel() {
		return this.voltageLevel;
	}

	public void setVoltageLevel(VoltageLevel voltageLevel) {
		this.voltageLevel = voltageLevel;
	}
}